home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Shareware / IDimager Personal 4.2.0.3 / setup_IDimager_Personal_V4.exe / {app} / web / modules / collimages.psc < prev    next >
Text File  |  2008-06-11  |  2KB  |  59 lines

  1.  
  2. %code
  3.  
  4. %include storeddata.inc %/include
  5. %include resulttable.inc %/include
  6.  
  7. var
  8.   AItems: TCatalogItems;
  9.   AColl: TImageCollection;
  10.   i: Integer;
  11. begin
  12.   if not FindStoredData ('dsITEMS', AItems, False) then
  13.   begin
  14.     AItems := TCatalogItems.Create (TCatalogItem, '');
  15.     StoreData ('dsITEMS', AItems);
  16.   end;
  17.  
  18.   if AItems.GUID <> Request.Params.Values['GUID'] then
  19.   begin
  20.     AItems.Clear;
  21.     AItems.LastSort := csNone;    // set to no sort so that the collection order is maintained
  22.     //AItems.LastSortOrder := stDescending;
  23.  
  24.     AColl := TImageCollection.Create(nil);
  25.     AColl.GUID := Request.Params.Values['GUID'];
  26.     Catalog.EnumModelCollection (AColl, False);
  27.     Catalog.EnumCollectionDetails (AColl);
  28.  
  29.     AItems.LastSort := AColl.LastSort;
  30.     AItems.LastSortOrder := AColl.LastSortOrder;
  31.  
  32.     Catalog.EnumPhotosCollection (AColl, AItems, True, vptAlbumDisplay);
  33.  
  34.     AItems.Name := toWideString('');
  35.  
  36.     AItems.GUID := Request.Params.Values['GUID'];
  37.  
  38.     if Nvl(SessionData.Prop['IsAdmin'], False) then
  39.     begin
  40.       AItems.Name := AItems.Name + 
  41.                      '<a href="%var:HomePage/%var:PageOffset/showcollection.psc?GUID=' + AItems.GUID + '" title="direct link to this collection..." target="_new">' +
  42.                      '<img src="%var:PageOffset/images/link.png">' +
  43.                      '</a>' +
  44.                      '';
  45.     end;
  46.  
  47.     AItems.Name := AItems.Name + 
  48.                    AColl.CollectionName + 
  49.                    '<span class="small"><br/>' + 
  50.                    AColl.CollectionDescription.Text +
  51.                    '</span>';
  52.  
  53.     AColl.Free;
  54.   end;
  55.   
  56.   result := IncludeResultTable (AItems, 'dsITEMS', 1, 0, 0);
  57. end;
  58.  
  59. %/code